Repository navigation
feat(ourlogs): Add a trace item details endpoint + tests - #86235
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #86235 +/- ##
===========================================
+ Coverage 46.68% 87.96% +41.27%
===========================================
Files 9707 9728 +21
Lines 550543 551655 +1112
Branches 21483 21483
===========================================
+ Hits 257043 485273 +228230
+ Misses 293133 66015 -227118
Partials 367 367 |
|
Can we remove the |
json doesn't support big integers - that's the big reason otel does it this way |
2811757 to
757554f
Compare
k-fish
left a comment
There was a problem hiding this comment.
Assuming you check all the ACL / features are correct, otherwise 👍
| if dataset == "ourlogs": | ||
| trace_item_type = TRACE_ITEM_TYPE_LOG | ||
| else: | ||
| raise BadRequest(detail=f"Unknown dataset: '{dataset}'") |
There was a problem hiding this comment.
Maybe test this branch (can do it later too not super important)
| end_timestamp_proto = ProtoTimestamp() | ||
| end_timestamp_proto.GetCurrentTime() |
There was a problem hiding this comment.
If the timestamp is user submitted, we can't guarantee the window of GetCurrentTime is correct, but this should work for now.
| "itemId": resp["itemId"], | ||
| "timestamp": resp["timestamp"], | ||
| "attributes": { | ||
| attr["name"]: convert_rpc_attribute_to_json(attr["value"]) |
|
|
||
|
|
||
| @region_silo_endpoint | ||
| class ProjectTraceItemDetailsEndpoint(ProjectEndpoint): |
There was a problem hiding this comment.
Does this base class guarantee the project ACL?
### Summary This adds the EventsTagTree like behaviour that queries and shows all log details when opening a row. Once we figure out the rest of the EAP items tables / detail views we can make a generic component. Blocked on #86235 to replace the mock data in the hook with an actual backend call. #### Screenshots 
We want to be able to get all of the details for a specific trace-item, for example, a log or span.
This endpoint facilitates that - it was not merged with the existing event APIs because it has a different response schema.
Example request: http://localhost:7899/api/0/projects/sentry/python/trace-items/01955DB7E34B7412992D6E5CD3027FFB/?dataset=ourlogs
Example response: